﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Dashboard
{
    public partial class UC_Dashboard : UserControl
    {
        IniFiles ini;
        public UC_Dashboard()
        {
            InitializeComponent();
        }

        private void UC_Dashboard_Load(object sender, EventArgs e)
        {
            ini = new IniFiles("setting.ini");
            this.comboBox1.Text = ini.ReadString("Dashboard", "main", "");
            this.comboBox2.Text = ini.ReadString("Dashboard", "button1", "");
            this.comboBox3.Text = ini.ReadString("Dashboard", "button2", "");
            this.comboBox4.Text = ini.ReadString("Dashboard", "button3", "");
            this.comboBox5.Text = ini.ReadString("Dashboard", "button4", "");
            this.comboBox6.Text = ini.ReadString("Dashboard", "button5", "");
            this.comboBox7.Text = ini.ReadString("Dashboard", "button6", "");
            this.comboBox8.Text = ini.ReadString("Dashboard", "button7", "");
            this.comboBox9.Text = ini.ReadString("Dashboard", "button8", "");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ini.WriteString("Dashboard", "main", this.comboBox1.Text);
            ini.WriteString("Dashboard", "button1", this.comboBox2.Text);
            ini.WriteString("Dashboard", "button2", this.comboBox3.Text);
            ini.WriteString("Dashboard", "button3", this.comboBox4.Text);
            ini.WriteString("Dashboard", "button4", this.comboBox5.Text);
            ini.WriteString("Dashboard", "button5", this.comboBox6.Text);
            ini.WriteString("Dashboard", "button6", this.comboBox7.Text);
            ini.WriteString("Dashboard", "button7", this.comboBox8.Text);
            ini.WriteString("Dashboard", "button8", this.comboBox9.Text);
        }
    }
}
